/*!
 * ---------------------------------------------------------------------
 *
 * GLPI - Gestionnaire Libre de Parc Informatique
 *
 * http://glpi-project.org
 *
 * @copyright 2015-2024 Teclib' and contributors.
 * @copyright 2003-2014 by the INDEPNET Development Team.
 * @licence   https://www.gnu.org/licenses/gpl-3.0.html
 *
 * ---------------------------------------------------------------------
 *
 * LICENSE
 *
 * This file is part of GLPI.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 * ---------------------------------------------------------------------
 */

/* stylelint-disable property-no-vendor-prefix */
body {
    .flatpickr-calendar {
        --glpi-flatpickr-bg: var(--tblr-bg-surface);
        --glpi-flatpickr-text-color: var(--tblr-body-color);
        --glpi-flatpickr-accent-color: color-mix(in srgb, var(--tblr-link-color), transparent 50%);
        --glpi-flatpickr-date-hover-bg: color-mix(in srgb, var(--glpi-flatpickr-accent-color), transparent 40%);
        --glpi-flatpickr-date-selection-hover-bg: color-mix(in srgb, var(--glpi-flatpickr-accent-color), transparent 30%);
        --glpi-flatpickr-date-selection-fg: var(--glpi-flatpickr-text-color);
        --glpi-flatpickr-border-color: var(--tblr-border-color);
        --glpi-flatpickr-shadow-color: color-mix(in srgb, var(--tblr-body-color), transparent 96%);
        --glpi-flatpickr-faded-color: color-mix(in srgb, var(--tblr-body-color), transparent 70%);

        background: var(--glpi-flatpickr-bg);
        -webkit-box-shadow: 1px 0 0 var(--glpi-flatpickr-shadow-color), -1px 0 0 var(--glpi-flatpickr-shadow-color), 0 1px 0 var(--glpi-flatpickr-shadow-color), 0 -1px 0 var(--glpi-flatpickr-shadow-color), 0 3px 13px var(--glpi-flatpickr-shadow-color);
        box-shadow: 1px 0 0 var(--glpi-flatpickr-shadow-color), -1px 0 0 var(--glpi-flatpickr-shadow-color), 0 1px 0 var(--glpi-flatpickr-shadow-color), 0 -1px 0 var(--glpi-flatpickr-shadow-color), 0 3px 13px var(--glpi-flatpickr-shadow-color);
    }

    .flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1) {
        -webkit-box-shadow: -2px 0 0 var(--glpi-flatpickr-shadow-color), 5px 0 0 var(--glpi-flatpickr-shadow-color);
        box-shadow: -2px 0 0 var(--glpi-flatpickr-shadow-color), 5px 0 0 var(--glpi-flatpickr-shadow-color);
    }

    .flatpickr-calendar.hasTime .flatpickr-time {
        border-top: 1px solid var(--glpi-flatpickr-border-color);
    }

    .flatpickr-calendar.arrowTop::before {
        border-bottom-color: var(--glpi-flatpickr-border-color);
    }

    .flatpickr-calendar.arrowTop::after {
        border-bottom-color: var(--glpi-flatpickr-bg);
    }

    .flatpickr-calendar.arrowBottom::before {
        border-top-color: var(--glpi-flatpickr-border-color);
    }

    .flatpickr-calendar.arrowBottom::after {
        border-top-color: var(--glpi-flatpickr-bg);
    }

    .flatpickr-months .flatpickr-month {
        background: var(--glpi-flatpickr-bg);
        color: var(--glpi-flatpickr-text-color);
        fill: var(--glpi-flatpickr-text-color);
    }

    .flatpickr-months .flatpickr-prev-month,
    .flatpickr-months .flatpickr-next-month {
        color: var(--glpi-flatpickr-text-color);
        fill: var(--glpi-flatpickr-text-color);
    }

    .flatpickr-months .flatpickr-prev-month:hover,
    .flatpickr-months .flatpickr-next-month:hover {
        color: var(--glpi-flatpickr-text-color);
    }

    .flatpickr-months .flatpickr-prev-month:hover svg,
    .flatpickr-months .flatpickr-next-month:hover svg {
        fill: var(--glpi-flatpickr-accent-color);
    }

    .numInputWrapper:hover {
        background: transparent;
    }

    .flatpickr-current-month span.cur-month:hover {
        background: transparent;
    }

    .flatpickr-current-month .numInputWrapper span.arrowUp::after {
        border-bottom-color: var(--glpi-flatpickr-text-color);
    }

    .flatpickr-current-month .numInputWrapper span.arrowDown::after {
        border-top-color: var(--glpi-flatpickr-text-color);
    }

    .flatpickr-current-month .flatpickr-monthDropdown-months {
        background: var(--glpi-flatpickr-bg);
    }

    .flatpickr-current-month .flatpickr-monthDropdown-months:hover {
        background: transparent;
    }

    .flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month {
        background-color: var(--glpi-flatpickr-bg);
    }

    span.flatpickr-weekday {
        background: var(--glpi-flatpickr-bg);
        color: var(--glpi-flatpickr-text-color);
    }

    .dayContainer + .dayContainer {
        -webkit-box-shadow: -1px 0 0 var(--glpi-flatpickr-shadow-color);
        box-shadow: -1px 0 0 var(--glpi-flatpickr-shadow-color);
    }

    .flatpickr-day {
        color: var(--glpi-flatpickr-text-color);
    }

    .flatpickr-day.inRange,
    .flatpickr-day.prevMonthDay.inRange,
    .flatpickr-day.nextMonthDay.inRange,
    .flatpickr-day.today.inRange,
    .flatpickr-day.prevMonthDay.today.inRange,
    .flatpickr-day.nextMonthDay.today.inRange,
    .flatpickr-day:hover,
    .flatpickr-day.prevMonthDay:hover,
    .flatpickr-day.nextMonthDay:hover,
    .flatpickr-day:focus,
    .flatpickr-day.prevMonthDay:focus,
    .flatpickr-day.nextMonthDay:focus {
        background: var(--glpi-flatpickr-date-hover-bg);
        border-color: var(--glpi-flatpickr-date-hover-bg);
    }

    .flatpickr-day.today {
        border-color: var(--glpi-flatpickr-text-color);
    }

    .flatpickr-day.today:hover,
    .flatpickr-day.today:focus {
        border-color: var(--glpi-flatpickr-text-color);
        background: var(--glpi-flatpickr-text-color);
        color: var(--glpi-flatpickr-bg);
    }

    .flatpickr-day.selected,
    .flatpickr-day.startRange,
    .flatpickr-day.endRange,
    .flatpickr-day.selected.inRange,
    .flatpickr-day.startRange.inRange,
    .flatpickr-day.endRange.inRange,
    .flatpickr-day.selected:focus,
    .flatpickr-day.startRange:focus,
    .flatpickr-day.endRange:focus,
    .flatpickr-day.selected:hover,
    .flatpickr-day.startRange:hover,
    .flatpickr-day.endRange:hover,
    .flatpickr-day.selected.prevMonthDay,
    .flatpickr-day.startRange.prevMonthDay,
    .flatpickr-day.endRange.prevMonthDay,
    .flatpickr-day.selected.nextMonthDay,
    .flatpickr-day.startRange.nextMonthDay,
    .flatpickr-day.endRange.nextMonthDay {
        background: var(--glpi-flatpickr-date-selection-hover-bg);
        color: var(--glpi-flatpickr-date-selection-fg);
        border-color: var(--glpi-flatpickr-date-selection-hover-bg);
    }

    .flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)),
    .flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)),
    .flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)) {
        -webkit-box-shadow: -10px 0 0 var(--glpi-flatpickr-date-selection-hover-bg);
        box-shadow: -10px 0 0 var(--glpi-flatpickr-date-selection-hover-bg);
    }

    .flatpickr-day.flatpickr-disabled,
    .flatpickr-day.flatpickr-disabled:hover,
    .flatpickr-day.prevMonthDay,
    .flatpickr-day.nextMonthDay,
    .flatpickr-day.notAllowed,
    .flatpickr-day.notAllowed.prevMonthDay,
    .flatpickr-day.notAllowed.nextMonthDay {
        color: var(--glpi-flatpickr-faded-color);
    }

    .flatpickr-day.inRange {
        -webkit-box-shadow: -5px 0 0 var(--glpi-flatpickr-date-hover-bg), 5px 0 0 var(--glpi-flatpickr-date-hover-bg);
        box-shadow: -5px 0 0 var(--glpi-flatpickr-date-hover-bg), 5px 0 0 var(--glpi-flatpickr-date-hover-bg);
    }

    .flatpickr-day.week.selected {
        -webkit-box-shadow: -5px 0 0 var(--glpi-flatpickr-date-selection-hover-bg), 5px 0 0 var(--glpi-flatpickr-date-selection-hover-bg);
        box-shadow: -5px 0 0 var(--glpi-flatpickr-date-selection-hover-bg), 5px 0 0 var(--glpi-flatpickr-date-selection-hover-bg);
    }

    .flatpickr-weekwrapper .flatpickr-weeks {
        -webkit-box-shadow: 1px 0 0 var(--glpi-flatpickr-shadow-color);
        box-shadow: 1px 0 0 var(--glpi-flatpickr-shadow-color);
    }

    .flatpickr-weekwrapper span.flatpickr-day,
    .flatpickr-weekwrapper span.flatpickr-day:hover {
        color: var(--glpi-flatpickr-faded-color);
    }

    .flatpickr-time .numInputWrapper span.arrowUp::after {
        border-bottom-color: var(--glpi-flatpickr-text-color);
    }

    .flatpickr-time .numInputWrapper span.arrowDown::after {
        border-top-color: var(--glpi-flatpickr-text-color);
    }

    .flatpickr-time input {
        color: var(--glpi-flatpickr-text-color);
    }

    .flatpickr-time .flatpickr-time-separator,
    .flatpickr-time .flatpickr-am-pm {
        color: var(--glpi-flatpickr-text-color);
    }

    .flatpickr-time input:hover,
    .flatpickr-time .flatpickr-am-pm:hover,
    .flatpickr-time input:focus,
    .flatpickr-time .flatpickr-am-pm:focus {
        background: transparent;
    }

    .flatpickr input.form-control {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }
}
/* stylelint-enable property-no-vendor-prefix */
